package com.learn.springboot3.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName: MinioConfig
 * Package: com.learn.springboot3.config
 * Description:
 *
 * @Author jiangcheng
 * @Create 2024/9/24 10:21
 * @Version 1.0
 */

@Configuration
public class MinioConfig {

    @Autowired
    private MinioPropertiesConfig minioProperties;


    @Bean
    public MinioClient minioClient(){
        MinioClient minioClient = MinioClient.builder().
                endpoint(minioProperties.getEndpoint()).
                credentials(minioProperties.getAccessKey(),
                        minioProperties.getSecretKey()).
                build();
        return minioClient;
    }

}
